package com.util;

import java.text.DecimalFormat;

public class Numeral {

	public static void main(String[] args) {
		String data = dataFormate(3123.12343, "#.#");
		System.out.println(data);
	}

	public static String dataFormat(double f, String format) {
		DecimalFormat df = new DecimalFormat(format);
		return df.format(f);
	}
	
	    public static String dataFormate(double d, String format) {
	        DecimalFormat decimalFormat = new DecimalFormat(format);
	        return decimalFormat.format(d);
	    }

}
